//
//  ZH_EvaluationImageCollectionViewCell.m
//  ChangeMerchants
//
//  Created by zhangliwen on 2018/10/10.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_EvaluationImageCollectionViewCell.h"
@interface ZH_EvaluationImageCollectionViewCell()
@property (nonatomic,weak)UIImageView *pngImageView;
@end
@implementation ZH_EvaluationImageCollectionViewCell
///注册cell
+(void)registerCollectionView:(UICollectionView*)collectionView
{
    [collectionView registerClass:[ZH_EvaluationImageCollectionViewCell class] forCellWithReuseIdentifier:@"ZH_EvaluationImageCollectionViewCell"];
}

///创建
+(id)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return [collectionView dequeueReusableCellWithReuseIdentifier:@"ZH_EvaluationImageCollectionViewCell" forIndexPath:indexPath];
}
//初始化
-(void)initDefault
{
    
}
- (void)updataImage:(NSString *)image{
    [self.pngImageView sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",SERVER_TEST,image]]];
}
///加载子视图约束
-(void)loadSubviewConstraints
{
    [self.pngImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(self.contentView);
    }];
}
///图片
- (UIImageView *)pngImageView
{
    if(!_pngImageView){
        UIImageView *image = [UIImageView createImageViewWithName:@""];
        image.backgroundColor = kFontColorRed;
        image.layer.cornerRadius = FITSCALE(3);
        image.layer.masksToBounds = YES;
        image.contentMode = UIViewContentModeScaleAspectFill;
        image.clipsToBounds = YES;
        [self.contentView addSubview:_pngImageView = image];
    }
    return _pngImageView;
}
@end
